{include file='comdir/head.html'}
<body>
<div class="content">
	<div class="animated fadeInDown">
     
		<div class="btn-box">
			<button class="btn btn-sm btn-success back_inline" onclick="addContentType();">添加</button>
		</div>
      
		<div class="table_list_wrap_layer">
			<div class="table-responsive">
				<table class="table table-bordered table-hover">
					<thead>
                        <tr>
                            <th>专题内容分类名称</th>
                            <th>创建人</th>
                            <th>创建时间</th>
                            <th>关联文章数</th>
                            <th>操作</th>
                        </tr>
					</thead>
					<tbody class="listtbody">
                    {foreach from=$list item=vo}
                    <tr class="specialcotent_{$vo.id}">
                        <td>{$vo.ctypename}</td>
                        <td>{$vo.displayname}</td>
                        <td>{$vo.addtime|date_format:'%Y-%m-%d %H:%M:%S'}</td>
                        <td>{$vo.rnum}</td>
                        <td>
                            <input type="button" onclick="edit({$vo.id})" class="btn btn-xs btn-warning" value="编辑">
                            <input type="button" onclick="del({$vo.id})" class="btn btn-xs btn-warning" value="删除">
                        </td>
                    </tr>
                    {/foreach}
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
    var _URL='{$_URL}';
    var specialid='{$id}';
    {literal}
    var addcontenttype;
    function addContentType() {
         addcontenttype=layer.open({
            type: 2,
            title: '添加专题内容分类',
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['400px', '300px'],
            content: _URL+"Special/addContentType?id="+specialid
        });
    }
    function cotenttypelist_back(){
        layer.close(addcontenttype);
        window.location.reload();
    }
    function cotenttypeedit_back(){
        layer.close(editcontenttype);
        window.location.reload();
    }
    var editcontenttype;
    //编辑专题
    function edit(id){
        editcontenttype=layer.open({
            type: 2,
            title: '添加专题内容分类',
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['400px', '300px'],
            content: _URL+"Special/editContentType?id="+id
        });
    }
    function del(id) {
        var url=_URL+"Special/delContentType";
            var del_all=layer.confirm('确认要删除吗！', {btn: ['确认','取消'],'title':'站点'},function(){
                _ajaxs.post(url,'id='+id,function(data){
                    layer.msg(data.msg,{icon: 1}, function(){
                        if(data.status){
                             $('.specialcotent_'+id).remove();
                        }
                         layer.close(index);
                    });
                })
            });
    }
    {/literal}
</script>

</body>
</html>